<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition  xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:a4j="http://richfaces.org/a4j" template="layouts/layout.xhtml"
   >
   <ui:define name="content">
<h:form>
<rich:panel>
        <f:facet name="header">
            <h:outputText value="New Group: "></h:outputText>
        </f:facet>
        <rich:panel id="addGroupPanel">
        <h:panelGrid columns="3">
             <h:outputText value="Name: "/>
            <rich:inplaceInput  name="groupName" id="groupname" required="true" value="#{wsStockGroupController.model.name}"  defaultLabel="Enter Items Group that you want to add" minInputWidth="150px;" >
            <f:validateLength minimum="3"  />
            </rich:inplaceInput>
             <rich:message  for="groupname">
                        <f:facet name="errorMarker">
                           
                        </f:facet>
                    </rich:message>
                    
                    
             <h:outputText value="Alise:" />
            <rich:inplaceInput  id="groupalias" value="#{wsStockGroupController.model.alias}" defaultLabel=" This is the alias "/>
            <rich:message for="groupalias">
             <f:facet name="errorMarker">
                           
              </f:facet>
             </rich:message>
                    
            
             <h:outputText value="Under" />
             <rich:inplaceSelect id="parentgroupSelect" listHeight="500px" listWidth="350px"  defaultLabel="--select--" value="#{wsStockGroupController.model.parentID}" openOnEdit="true">
               <f:selectItems value="#{wsStockGroupController.model.groups}" var="units" 
    		itemLabel="#{units.name}" itemValue="#{units.groupID}" />
            </rich:inplaceSelect>
            
             <rich:message for="parentgroupSelect">
                        <f:facet name="errorMarker">
                           
                        </f:facet>
                    </rich:message>
            
             <h:outputText value="Des:" />
             <h:inputTextarea id="textareaDesc"  value="#{wsStockGroupController.model.des}" rows="4" cols="35" >
             </h:inputTextarea>
             
              <rich:message for="textareaDesc">
                        <f:facet name="errorMarker">
                                   </f:facet>
                    </rich:message>
             
           </h:panelGrid>
     </rich:panel>
       <a4j:commandButton id="addGroup" type="submit" actionListener="#{wsStockGroupController.addModel}" value="Save Group" render="addGroupPanel"  />
      </rich:panel>
</h:form>
</ui:define>
</ui:composition>
